class BootstrapForm:
    exclude_field_list = []

    def __init__(self, *args, **kwargs):
        # 根据MRO method resolution order方法解析顺序
        super().__init__(*args, **kwargs)

        # {{ field }} 美化
        for name, field in self.fields.items():
            # print(name, field)  # role <django.forms.fields.ChoiceField object at 0x0000023193A5CAC0>
            if name in self.exclude_field_list:
                continue
            field.widget.attrs["class"] = "form-control"
            field.widget.attrs['placeholder'] = "请输入{}".format(field.label)